﻿package cn.whdream.info;
/**
 * 
 * @author admin
 *  优先级
 */
public class InfoDemo2 {
	
	public static void main(String[] args) throws InterruptedException {
		MyThread thread = new MyThread();
		Thread proxy = new Thread(thread,"挨踢");
		MyThread thread1 = new MyThread();
		Thread proxy1 = new Thread(thread,"挨踢1");
		System.out.println(proxy.getName());
		System.out.println(Thread.currentThread().getName());
		//优先级不代表绝对的先后顺序，而是代表分到cpu资源的多少
		proxy.setPriority(Thread.MIN_PRIORITY);
		proxy1.setPriority(Thread.MAX_PRIORITY);
		proxy.start();
		proxy1.start();
		Thread.sleep(100);
		thread.stopThread();
		thread1.stopThread();

	}
}
